package com.room2.ui;

import android.app.Application;

import com.room2.App;
import com.room2.model.Score;
import com.room2.model.User;
import com.room2.model.UserDao;

import java.util.List;

import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;

public class UserViewModel extends AndroidViewModel {

    private UserRepository repository;
    public UserViewModel(@NonNull Application application) {
        super(application);
        repository = new UserRepository();
    }

    public LiveData<List<User>> getGetAllData() {
        return repository.getAllData;
    }

    public void insert(User... users) {
        repository.insert(users);
    }

    public void update(User... users) {
        repository.update(users);
    }

    public void delete(String name) {
        repository.delete(name);
    }

    public void clear() {
        repository.clear();
    }
}
